
/****** Object:  Table [dbo].[purchase_t]    Script Date: 06/10/2010 15:05:39 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[purchase_t](
	[cCompanyID] [varchar](10) NOT NULL,
	[nIdentity] [decimal](18, 0) IDENTITY(1,1) NOT NULL,
	[cTranNo] [varchar](15) NOT NULL,
	[cRefNo] [varchar](20) NULL,
	[nRefIdentity] [decimal](18, 0) NULL,
	[cWH] [varchar](10) NOT NULL,
	[cItemNo] [dbo].[ItemNumber] NOT NULL,
	[cDesc] [varchar](100) NULL,
	[cUnit] [varchar](6) NULL,
	[nQty] [numeric](20, 2) NOT NULL,
	[nPrice] [numeric](20, 2) NOT NULL,
	[nAmount] [numeric](20, 2) NOT NULL,
	[cBatchID] [varchar](50) NULL,
	[nCost] [float] NOT NULL,
	[cReason] [varchar](30) NULL,
	[nFactor] [numeric](20, 2) NOT NULL,
	[lOtherItem] [bit] NOT NULL,
	[cLongDesc] [varchar](2500) NULL
) ON [PRIMARY]
SET ANSI_PADDING OFF
ALTER TABLE [dbo].[purchase_t] ADD [cBarcodeID] [varchar](25) NULL

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[purchase_t] ADD  CONSTRAINT [DF_purchase_T_nQty]  DEFAULT (0) FOR [nQty]
GO

ALTER TABLE [dbo].[purchase_t] ADD  CONSTRAINT [DF_purchase_T_nPrice]  DEFAULT (0) FOR [nPrice]
GO

ALTER TABLE [dbo].[purchase_t]  ADD  CONSTRAINT [DF_purchase_T_nAmount]  DEFAULT (0) FOR [nAmount]
GO

ALTER TABLE [dbo].[purchase_t] ADD  CONSTRAINT [DF_purchase_T_nCost]  DEFAULT (0) FOR [nCost]
GO

ALTER TABLE [dbo].[purchase_t] ADD  CONSTRAINT [DF_purchase_T_nFactor]  DEFAULT (0) FOR [nFactor]
GO

ALTER TABLE [dbo].[purchase_t] ADD  CONSTRAINT [DF_purchase_T_lOtherItem]  DEFAULT (0) FOR [lOtherItem]
GO

